import numpy as np
import matplotlib.pyplot as plt

from matplotlib.font_manager import FontProperties
pic_font = FontProperties(fname=r"/System/Library/Fonts/PingFang.ttc", size=12) 

x=[0,34,67,101,135,202,259,336,404,471]
y=[15.18,21.36,25.72,32.29,34.03,39.45,43.15,43.46,40.83,30.75]
poly = np.polyfit(x,y,deg = 4)
plt.plot(x,y,'r+-')
x_1 = np.linspace(0,500,num = 100)
plt.plot(x_1, np.polyval(poly, x_1), 'g')
plt.plot(300, np.polyval(poly, 300), '+')
plt.text(250,40,'$(300, 43.83)$')
plt.xlabel('氮肥量', FontProperties = pic_font)
plt.ylabel('土豆产量', FontProperties = pic_font)
plt.title('ZC2018310516 王逸轩', FontProperties = pic_font)
plt.show()